<template class="Index_i_personal">
    <div class="personindex"  v-infinite-scroll="loadMore" infinite-scroll-disabled="busy" infinite-scroll-distance="20"><!--v-infinite-scroll="loadMore" infinite-scroll-disabled="busy" infinite-scroll-distance="50"-->
        <header class="index-header header_header">
            <!--头部-->
            <div class="left-info" v-if="false"><!--@click="dw_href"-->
                <span class="add-name"></span><!--城市@click="dw_href"-->
                <i class="add-icon1"></i>
            </div>
            <div class="center-info" style="margin-left:60px;">
                <router-link :to="{name:'Seach'}"><input type="text" class="text-input" placeholder="优惠美食/智慧购物/折扣专享等"></router-link>
                <i class="searth-icon"></i>
            </div>
            <div class="right-info">
                <i class="code" v-show="false"></i>
                <i class="code1" @click="scan"></i>
            </div>
        </header>
        <div data-role="page" id="pageone">
            <!--广告轮播-->
            <div class="swiper-container">
                <swiper :options="swiperOption" ref="mySwiper" class="swiper-wrapper">
                    <!-- slides -->
                    <swiper-slide class="swiper-slide" v-for="(item,ui) in bannerr" :key="ui"><router-link :to="{name:'Commodity_details',query:{id:item.goodsId,subid:0}}"><img :src=item.activityImageUrl></router-link></swiper-slide>
                </swiper>
                <!-- Optional controls -->
                <div class="swiper-pagination banner_new"></div>
            </div>

            <!-- <ul class="nav fu18">
                <li>
                    <router-link :to="{name:'Discount_list',params:{id:12,subid:0}}">
                        <img src="../../assets/personal/images/icon.png" />
                        <p>美食餐馆</p>
                    </router-link>
                </li>
                <li>
                    <router-link :to="{name:'Discount_list',params:{id:38,subid:0}}">
                        <img src="../../assets/personal/images/icon1.png" />
                        <p>汽车用品</p>
                    </router-link>
                </li>
                <li>
                    <router-link :to="{name:'Discount_list',params:{id:2,subid:0}}">
                        <img src="../../assets/personal/images/icon2.png" />
                        <p>购物折扣</p>
                    </router-link>
                </li>
                <li>
                    <router-link :to="{name:'Discount_list',params:{id:37,subid:0}}">
                        <img src="../../assets/personal/images/icon3.png" />
                        <p>酒店住宿</p>
                    </router-link>
                </li>
                <li>
                    <router-link :to="{name:'Discount_list',params:{id:26,subid:0}}">
                        <img src="../../assets/personal/images/icon4.png" />
                        <p>旅游度假</p>
                    </router-link>
                </li>
                <li>
                    <router-link :to="{name:'Discount_list',params:{id:30,subid:0}}">
                        <img src="../../assets/personal/images/icon5.png" />
                        <p>休闲娱乐</p>
                    </router-link>
                </li>
                <li>
                    <router-link :to="{name:'Discount_list',params:{id:24,subid:0}}">
                        <img src="../../assets/personal/images/icon6.png" />
                        <p>生活服务</p>
                    </router-link>
                </li>
                <li>
                    <router-link :to="{name:'More_industry'}">
                        <img src="../../assets/personal/images/icon7.png" />
                        <p>更多行业</p>
                    </router-link>
                </li>
            </ul>  -->



              <ul class="nav fu18 lllli" style="margin-bottom: 8px;">
                <li @click="liyonglinSB">
                    <img src="../../assets/personal/images/qiyezhaoshang.png" class="nav_img" style="height:30px; margin-top:5px;"/>
                    <p>企业招商</p>
                </li>
                <li @click="liyonglinSB">
                    <img src="../../assets/personal/images/faluyanz.png" class="nav_img"/>
                    <p>法律援助</p>
                </li>
                <li @click="liyonglinSB">
                    <img src="../../assets/personal/images/zhengfuyinzi.png" class="nav_img"/>
                    <p>政府引资</p>
                </li>
                <li @click="liyonglinSB">
                    <img src="../../assets/personal/images/zhengfujidu.png" class="nav_img" />
                    <p>政策解读</p>
                </li>
                <li @click="liyonglinSB">
                    <img src="../../assets/personal/images/tourong.png" class="nav_img"/>
                    <p>投融服务</p>
                </li>
                <li @click="liyonglinSB">
                    <img src="../../assets/personal/images/yinkedaoliu.png" class="nav_img"/>
                    <p>引客导流</p>
                </li>
                <li @click="liyonglinSB">
                    <img src="../../assets/personal/images/zhaopinqiuzhi.png" class="nav_img"/>
                    <p>招聘求职</p>
                </li>
                <li @click="liyonglinSB">
                    <img src="../../assets/personal/images/qitafuwu.png" class="nav_img" style="height:30px; margin-top:5px;"/>
                    <p>其他服务</p>
                </li>
            </ul>

              <!-- 新增八大入口 -->
              <!-- <ul class="nav fu18 lllli" style="margin-bottom: 8px; padding-left:10px; padding-right:10px;">
                <li>
                    <router-link :to="{path:'new_product'}" class="new_act">
                    <img src="../../assets/personal/images/new1.png" class="nav_img" style=""/>
                    <p>新品上市</p>
                    </router-link>
                </li>
                <li>
                     <router-link :to="{path:'new_tuijian'}" class="new_act">
                    <img src="../../assets/personal/images/new2.png" class="nav_img"/>
                    <p>为你推荐</p>
                     </router-link>
                </li>
                <li>
                      <router-link :to="{path:'new_coupon'}" class="new_act">
                    <img src="../../assets/personal/images/new3.png" class="nav_img"/>
                    <p>领劵中心</p>
                     </router-link>
                </li>
                <li>
                     <router-link :to="{path:'new_nine'}" class="new_act">
                    <img src="../../assets/personal/images/new4.png" class="nav_img" />
                    <p>9.9包邮</p>
                     </router-link>
                </li>
                <li>
                     <router-link :to="{path:'new_seckill'}" class="new_act">
                    <img src="../../assets/personal/images/new5.png" class="nav_img"/>
                    <p>每日秒杀</p>
                     </router-link>
                </li>
                <li>
                     <router-link :to="{path:'new_baokuan'}" class="new_act">
                    <img src="../../assets/personal/images/new6.png" class="nav_img"/>
                    <p>爆款专区</p>
                     </router-link>
                </li>
                <li>
                     <router-link :to="{path:'new_classify'}" class="new_act">
                    <img src="../../assets/personal/images/new7.png" class="nav_img"/>
                    <p>分类商品</p>
                     </router-link>
                </li>
                <li>
                     <router-link :to="{path:'new_merchant'}" class="new_act">
                    <img src="../../assets/personal/images/new8.png" class="nav_img" style=""/>
                    <p>商家认证</p>
                     </router-link>
                </li>
            </ul> -->










            <!-- <div>
                 <router-link :to="{name:'me_index'}">
                   商家中心
                </router-link>
            </div>  -->
            <div>
              <!-- <a href="http://www.zzb1689.com/Vshop/Default.aspx?ReferralId=340659"> -->
              <a href="http://www.zzb1689.com/Vshop/Default.aspx?ReferralId=341619">
                <!-- <img src="../../assets/guanggao.png" style="vertical-align:middle; width:90%; margin-bottom:10px;" /> -->
                 <img src="http://static.ruitaowang.com/attached/file/2019/03/11/20190311091447631.jpg" style="vertical-align:middle; width:90%; margin-bottom:10px;" />
             </a>
            </div>
            <div class="idea-news-con" v-show="false">
                <router-link :to="{name:'xw_headline'}">
                    <img src="../../assets/personal/images/logo.png" alt="">
                </router-link>
                <router-link :to="{name:'xw_headline'}">
                    <div class="idea-news">
                        <div class="swiper-container con">
                            <swiper :options="headline" ref="mySwiper" class="swiper-wrapper ">
                                <!-- slides -->
                                <swiper-slide class="swiper-slide tex_con" v-for="(item,i) in hotln" :key="i"><router-link :to="{name:'xw_headline'}"><span class="xinwen">龙蛙理念</span></router-link><a>{{item.activityTitle}}</a></swiper-slide>
                                <swiper-slide class="swiper-slide tex_con" v-for="(itemc,ic) in  hotrd" :key="ic+'z'"><router-link :to="{name:'xw_headline'}"><span class="xinwen">首象热点</span></router-link><a>{{itemc.activityTitle}}</a></swiper-slide>

                            </swiper>
                            <!-- Optional controls -->
                        </div>
                        <!-- <ul style="margin-top: 0px;">
                          <li><span>龙蛙理念</span><a href="headline.html">精诚合作 共赢共荣</a></li>
                          <li><span>首象热点</span><a href="headline.html">首象商城上线啦！给您一次完美购物！</a></li>
                        </ul> -->
                    </div>
                </router-link>
            </div>
            <div class="advantage fu10 pnd" v-show="false">
                <router-link :to="{name:'Discount'}">
                    <img src="../../assets/personal/images/index-pic.png" />
                </router-link>

            </div>
            <!-- <div class="card-content">
              <div class="same-box">
                <router-link :to="{name:'Discount_list',params:{id:12,subid:0}}">
                <div class="left-info">
                   <h4 class="title">美食券</h4>
                  <p class="text">优惠美食享不停</p>
                </div>
                <div class="img-info">
                  <img src="../../assets/personal/images/index-pic1.png" alt="">
                </div>
               </router-link>
              </div>
              <div class="same-box">
                <router-link :to="{name:'Discount_list',params:{id:2,subid:0}}">
                <div class="left-info">
                  <h4 class="title">购物券</h4>
                  <p class="text">物美价廉享好物</p>
                </div>
                <div class="img-info">
                  <img src="../../assets/personal/images/index-pic2.png" alt="">
                </div>
                </router-link>
              </div>
              <div class="same-box">
                <router-link :to="{name:'Discount_list',params:{id:38,subid:0}}">
                <div class="left-info">
                  <h4 class="title">生活券</h4>
                  <p class="text">优惠美食享不停</p>
                </div>
                <div class="img-info">
                  <img src="../../assets/personal/images/index-pic3.png" alt="">
                </div>
                </router-link>
              </div>
              <div class="same-box">
                <router-link :to="{name:'Discount_list',params:{id:37,subid:0}}">
                <div class="left-info">
                  <h4 class="title">住宿券</h4>
                  <p class="text">物美价廉享好物</p>
                </div>
                <div class="img-info">
                  <img src="../../assets/personal/images/index-pic4.png" alt="">
                </div>
                </router-link>
              </div>
            </div> -->
            <!--弹层-->
            <!--<div class="layer-shaow">
                  <img src="../../assets/personal/images/layer-pic.png" class="layer-img" alt="">
              </div>-->
            <!-- <div class="shops-content">
                <div class="shops-same-info" v-for="(item,i) in shopsList" :key="'company'+i">
                    <router-link :to="{name:'Commodity',query:{id:item.company.companyId}}">
                        <div class="top-info">
                            <div class="img-info">
                                <img :src=item.company.headimgurl alt="">
                            </div>
                            <div class="text-content">
                                <p class="shops-title">{{item.company.companyName}}</p>
                                <div class="shops-add">
                                    <span class="text1"><i class="icon" style="margin-right:5px;"></i>{{item.company.address}}</span>
                                    <span class="text2" v-if="item.sign=='1kmdown'">| 距您{{item.distance}}米</span>
                                    <span class="text2" v-else-if="item.sign=='no sign'"></span>
                                    <span class="text2" v-else>| 距您{{item.distance}}公里</span>
                                    <div class="clix"></div>
                                </div>
                            </div>
                        </div>
                    </router-link>
                    <div class="center-info">
                        <router-link v-for="imgurl in item.goodsList" :key="imgurl.goodsId" :to="{name:'Commodity_details',query:{id:imgurl.goodsId,subid:0}}">
                            <img :src=imgurl.goodsThum alt="" :onerror="defaultImg">
                        </router-link>
                    </div>
                    <div class="bottom-info" v-for="coupons in item.coupons" :key="coupons.id" v-if="item.coupons.length>0">
                        <div class="jian">减</div>
                        <span class="txt">满{{coupons.reach1 | amountMin100(2)}}减{{coupons.score1 | amountMin100(2)}}</span>
                    </div>
                    <div class="bottom-info" v-for="coupons in item.coupons" :key="coupons.id" v-else>
                    </div>
                </div>
                <loadingtmp :busy="busy" :datalength="shopsList.length" :loadall="loadall"></loadingtmp>
            </div> -->
            <div class="shopListNew_2081119">
                <div class="shopListNew_2081119NAV">
                    <ul>
                        <li class="shopListNew_2081119NAVLi" :class="{shopListNew_2081119NAVLiACTIVE:ShopsListtype==0}" @click="ShopsListClk(0)">
                            推荐
                        </li>
                        <li class="shopListNew_2081119NAVLi" :class="{shopListNew_2081119NAVLiACTIVE:ShopsListtype==1}" @click="ShopsListClk(1)">
                            销量
                        </li>
                        <li class="shopListNew_2081119NAVLi" :class="{shopListNew_2081119NAVLiACTIVE:ShopsListtype==2}" @click="ShopsListClk(2)">
                            最新
                        </li>
                        <li class="shopListNew_2081119NAVLi" :class="{shopListNew_2081119NAVLiACTIVE:ShopsListtype==3}" @click="regionShow()">
                            地区
                        </li>
                    </ul>
                </div>
                <ul class="uulll">
                    <li class="shopListNew_2081119Li" v-for="item in shopsList" :key="item.goodsId" >
                        <router-link :to="{name:'Commodity_details',query:{id:item.goodsId,subid:0}}">
                            <img class="shopListNew_2081119IMG" :src=item.goodsThum :onerror="defaultImg">
                            <p class="shopListNew_2081119P1">{{item.goodsName}}</p>
                            <p v-if="1==sortType" class="shopListNew_2081119P3"><span class="shopListNew_2081119P3SP2">{{item.xiaoliang}}人付款</span></p>
                         </router-link>
                        <div class="shopListNew_2081119P2" @click="Detailedlist(item.goodsId)">
                            <p class="shopListNew_2081119P2SP"> ￥{{item.goodsScreenPrice | amountMin100(2)}}</p>
                            <p class="shopListNew_2081119P2SP2"  v-show="item.discount==1">原价￥{{item.goodsRealPrice | amountMin100(2)}}</p>
                            <!-- <img class="shopListNew_2081119P2IMG" src="../../assets/1_6.png"> -->
                        </div>
                        <div class="shopListNew_2081119P2R"  @click="Detailedlist(item.goodsId)">
                            <img class="shopListNew_2081119P2IMG" src="../../assets/1_6.png">
                        </div>
                    </li>
                </ul>
                <loadingtmp :busy="busy" :datalength="shopsList.length" :loadall="loadall"></loadingtmp>
            </div>
            <div class="h50"></div>
        </div>
        <div class="ruitao_erweima" v-if="!subscribed"><!--v-if="!subscribed"v-if="item.discount==0"-->
           <div class="ruitao_erweima1">
              <img src="../../assets/personal/images/121479915301942429.png">

           </div>
        </div>
        <navFooter :pageName=pageName></navFooter>
        <div class="region" v-show="region">
            <div class="regionShow">
                <p class="regionShowP">所在地<span class="regionclear" @click="regionclear">取消</span></p>
                <div class="anniu">
                    <ul>
                        <li @click="cityNameClick(currentCity)">
                            <img src="../../assets/personal/images/dingyiw.png" ><span>{{currentCity}}</span>
                        </li>
                        <li style="background: #fff;">
                            <img src="../../assets/personal/images/shuaxin.png"><span @click="getwxconfig()">定位</span>
                        </li>
                    </ul>
                </div>
                <p class="regionShowP">城市</p>
                    <div class="erduan">
                        <div class="zuobianList">
                            <div class="A_Znav">
                                <ul>
                                    <li class="A_ZnavLi">城市定位</li>
                                    <li style="line-height: 20px;" v-for="(item,ind) in A_zJson" :key="item.name"><a @click="A_ZnavLiClick(ind)">{{item.name}}</a></li>
                                </ul>
                            </div>
                        </div>
                        <ul class="listdiqu" v-if="1==listdiqu"><!--/api/wap/districts/city-->
                            <div  v-for="(itemc,index) in city" :key="index" >
                                <li v-for="(item,ind) in itemc" :key="ind" @click="cityNameClick(item.name)">
                                     {{item.name}}
                                 </li>
                            </div>
                        </ul>
                        <ul class="listdiqu" v-else><!--/api/wap/districts/city-->
                               <li v-for="(itemc,index) in city" :key="index"  @click="cityNameClick(itemc.name)"> {{itemc.name}}</li>
                        </ul>
                    </div>
            </div>
        </div>
        <!--v-show="msg=='失败'"-->
       <!-- <div class="shibai_new" v-show="msg=='失败'">
           <div class="shibai">
                <img src="../../assets/personal/images/zzzzzzz.png">
                <p>抱歉定位失败</p>
                <button style="background:red;color:#fff;  border-radius: 5px;" @click="refresh">点我重新加载</button>
                <p class="shibai_help"><img src="../../assets/personal/images/wenhao.png"><router-link  :to="{name:'help'}">帮助</router-link></p>
            </div>
        </div> -->
    </div>
</template>
<style lang="scss" scoped>
.nav_img{
    width:30px;
     height: 35px;
    margin-bottom: 10px;

    // 新增入口
    // width:40px;
    // height:40px;
    // margin-bottom: 5px;
}
.new_act{
    width:100%;
    height:100%;
    display:inline-block;
}
.lllli{
    li{
        margin:10px 0;
    }
}
</style>
<script>
   // import wx from 'weixin-js-sdk'
    import navFooter from '@/components/footer'
    import PhoneVerification from '@/components/PhoneVerification'
    // import ceshi from '@/components/ceshi'
    import { swiper, swiperSlide } from 'vue-awesome-swiper'
    import loadingtmp from '@/components/load/loading'
    export default {
        name: 'HelloWorld',
        template: "#gouwu",
        components: {
            swiper,
            swiperSlide,
            navFooter,
            loadingtmp,
            PhoneVerification
            // ceshi
        },
        data() {
            return {
              defaultImg: 'this.src="' + require('../../assets/image_bg_url.png') + '"',
                swiperOption: {//v-swiper
                    autoplay: true,
                    pagination: {
                        el: '.swiper-pagination',
                    }
                },
                headline: {
                    autoplay: {
                        delay: 3000
                    },
                    direction: 'vertical',
                },
                pageName: "index",
                bannerr: [],
                hotln: [],
                hotrd: [],
                shopsList: [],
                page: 1,
                pageSize: 50,
                busy:false,////////////
                loadall: false,
                defaultImg: 'this.src="' + require('../../assets/image_bg_url.png') + '"',
                subscribed: true,
                chengshi: '',
                currentCity: '北京市',//市北京市
                latitude1: '',   //纬度39.903230/////37.254329
                longitude1: '',    //经度116.397720//////139.693512
                msg: '操作成功啦',
                TiTle:'首象共享',
                shuoming:'首象共享！',
                urlid:'',
                ShopsListtype:0,
                sortType:0,
                A_zJson: [
                { "name": 'A', "id": '#A', "pinyin": 'a' },
                { "name": 'B', "id": '#B', "pinyin": 'b' },
                { "name": 'C', "id": '#C', "pinyin": 'c' },
                { "name": 'D', "id": '#D', "pinyin": 'd' },
                { "name": 'E', "id": '#E', "pinyin": 'e' },
                { "name": 'F', "id": '#F', "pinyin": 'f' },
                { "name": 'G', "id": '#G', "pinyin": 'g' },
                { "name": 'H', "id": '#H', "pinyin": 'h' },
                { "name": 'I', "id": '#I', "pinyin": 'i' },
                { "name": 'J', "id": '#J', "pinyin": 'j' },
                { "name": 'K', "id": '#K', "pinyin": 'k' },
                { "name": 'L', "id": '#L', "pinyin": 'l' },
                { "name": 'M', "id": '#M', "pinyin": 'm' },
                { "name": 'N', "id": '#N', "pinyin": 'n' },
                { "name": 'O', "id": '#O', "pinyin": 'o' },
                { "name": 'P', "id": '#P', "pinyin": 'p' },
                { "name": 'Q', "id": '#Q', "pinyin": 'q' },
                { "name": 'R', "id": '#R', "pinyin": 'r' },
                { "name": 'S', "id": '#S', "pinyin": 's' },
                { "name": 'T', "id": '#T', "pinyin": 't' },
                { "name": 'U', "id": '#U', "pinyin": 'u' },
                { "name": 'V', "id": '#V', "pinyin": 'v' },
                { "name": 'W', "id": '#W', "pinyin": 'w' },
                { "name": 'X', "id": '#X', "pinyin": 'x' },
                { "name": 'Y', "id": '#Y', "pinyin": 'y' },
                { "name": 'Z', "id": '#Z', "pinyin": 'z' },

            ],
            city:[],
            listdiqu:1,
            region:false,
            cityName:'',
            newding:1
            }
        },

        beforeCreate() {
            console.log("获取fk前");
            var fk = this.$route.query.fk;
            console.log(fk)
            if (!!fk && /^\d+-\d+-\d+-no-\d+$/g.test(fk)) {
                console.log("分析fk")
                var ar = fk.split("-");
                console.log(ar)
                window.localStorage.headid = ar[ar.length - 1];
                // this.$router.push({name:'Index'})
            }
        },
        created() {
            this.getwxconfig();
            // localStorage.headid =13
        },
        activated(){//本地
                console.log(this.$route.meta.isUseCache+"123456")
                this.newding=1
                console.log(this.newding)
                if(!this.$route.meta.isUseCache){
                this.shopsList = [];
                this.page =1;
                this.loadall =false;
                this.busy= false;
                this.loadMore();
                }
                this.$route.meta.isUseCache = false;
                 this.loadMore();
        },
        mounted() {
            // console.log(window.localStorage.headid)
            this.banner();
            this.scroLl();
            this.chksubscribed();
            this.city_list();
        },
        //  beforeRouteEnter( to, from,next){
        //         this.newding=1
        //         console.log(this.newding)
        //  },
        methods: {

         liyonglinSB:function(){
             layer.msg("尽请期待吧")
         },
         cityNameClick:function(name){//选择name
            this.cityName=name
            this.region=false
            this.page=1
            this.pageSize=50
            this.shopsList=[]
            this.loadMore()
            this.listdiqu=1
            this.city_list();
            console.log(this.cityName)
         },
         regionShow:function(){//显示地区层
            this.region=true
            this.sortType=3
            this.listdiqu=1
            this.city_list();
         },
         regionclear:function(){//地区取消选择
            this.region=false
            this.listdiqu=1
            this.city_list();
         },
         A_ZnavLiClick:function(id){//点击地区选择
             this.city=[]
             console.log(id)
             this.listdiqu=2
             this.$http.get(this.APIURL_PREFIX + "/api/wap/districts/city").then((response) => {
               this.city=response.data.data[id]
               console.log(this.city)
             }).catch(function (err) {
                console.log(err)
            });
         },
         city_list() {//地区接口
            this.$http.get(this.APIURL_PREFIX + "/api/wap/districts/city").then((response) => {
              this.city=response.data.data
            }).catch(function (err) {
                console.log(err)
            });
         },
         Detailedlist(id){///api/wap/shoppingCart  加入清单
            this.$http.post(this.APIURL_PREFIX+"/api/wap/shoppingCart",$.param({goodsId:id})).then((response) => {
                if(response.data.code ==0){
                        this.$router.push({ name: "Commodity_details_list"})
                }else if(response.data.code ==6){
                    layer.msg(response.data.msg)
                }
            }).
            catch(function(err){
                console.log(err)
            })
       },
        ShopsListClk(type){//列表选择
            this.ShopsListtype=type
            this.page=1
            this.pageSize=50
            this.sortType=type
            this.shopsList=[]
            this.loadMore()
        },
        shops(flag) {
            console.log(this.newding)
            if(this.newding==2){
                         return false;
                     }
            var vm = this;
            var params={}
            params.page=this.page
            params.rows=this.pageSize
            if(this.sortType==0){
                params.sortType=this.sortType
            }else if(this.sortType==1){
                params.sortType=this.sortType
            }else if(this.sortType==2){
                params.sortType=this.sortType
            }else if(this.sortType==3){
                params.cityName=this.cityName
            }
            params.sortType=this.sortType
            this.$http.get(this.APIURL_PREFIX + "/api/wap/seaElection",{params}).then((response) => {

                if (flag) {
                    this.shopsList = this.shopsList.concat(response.data.data);
                } else {
                    this.shopsList = response.data.data;
                }
                if (0 == response.data.data.length || response.data.data.length < this.pageSize) {
                    this.busy = true;
                    this.loadall = true;
                }
                else {
                    this.busy = false;
                    this.page++
                }
            }).catch(function (err) {
                console.log(err)
            });
        },
        loadMore() {
            console.log('下拉')
            this.busy = true;
            // clearTimeout(this.newding)
          setTimeout(() => {
                this.shops(this.page > 1);
                // console.log(this.newding)
                // return false;
            }, 500);
        },

            refresh:function(){
              window.location.reload();
           },
            map() {
                var vm = this;
                var geocoder = new qq.maps.Geocoder({
                    complete: function (result) {   //解析成功的回调函数
                        console.log(result.detail);
                        var address_city = result.detail.addressComponents.city   //市
                        vm.currentCity = address_city;
                        console.log("微信获取当前城市:", vm.currentCity)
                        vm.loadMore();
                    }
                })
                geocoder.getAddress(new qq.maps.LatLng(this.latitude1, this.longitude1))
            },
            chksubscribed() {
                console.log(111);
                this.$http.get(this.APIURL_PREFIX + "/api/wap/wx/subscribe").then((response) => {
                    console.log("查看是否关注");
                    console.log(response.data)
                    let responseTxt = response.data;
                    if (responseTxt.type == "SUCCESS") {
                        this.subscribed = responseTxt.data.subscribe == "1";
                    } else {
                        layer.msg(responseTxt.msg);
                    }
                }).catch(function (err) {
                    console.log(err)
                });
            },
            banner() {
                this.$http.get(this.APIURL_PREFIX + "/api/wap/activities?activityType=0").then((response) => {
                    this.bannerr = response.data.data[0];
                    console.log(response.data.data[0])
                }).catch(function (err) {
                    console.log(err)
                });
                // this.$http.get(this.APIURL_PREFIX + "/api/wap/activities?activityType=11").then((response) => {
                //     this.hotln = response.data.data[0]["activity11"];
                //     this.hotrd = response.data.data[0]["activity12"];
                //     console.log(this.hotln)
                //     console.log(this.hotrd);
                // }).catch(function (err) {
                //     console.log(err)
                // });
            },
            scan() {
                wx.scanQRCode({
                    needResult: 0, // 默认为0，扫描结果由微信处理，1则直接返回扫描结果，
                    scanType: ["qrCode", "barCode"], // 可以指定扫二维码还是一维码，默认二者都有
                    success: function (res) {
                        var result = res.resultStr; // 当needResult 为 1 时，扫码返回的结果
                    }
                });
            },
            scroLl() {
                $(window).scroll(function () {
                    if ($(window).scrollTop() > 1) {
                        $(".header_header").addClass('bgbg')
                    } else {
                        $(".header_header").removeClass("bgbg");
                    }
                });
            },
            // shops(flag) {
            //     var vm = this;
            //     this.$http.get(this.APIURL_PREFIX + "/api/wap/company/goods3/all", { params: { page: this.page, rows: this.pageSize, longitude: this.longitude1, latitude: this.latitude1, cityName: this.currentCity } }).then((response) => {
            //         if (flag) {
            //             this.shopsList = this.shopsList.concat(response.data.data);
            //         } else {
            //             this.shopsList = response.data.data;
            //         }
            //         if (0 == response.data.data.length || response.data.data.length < this.pageSize) {
            //             this.busy = true;
            //             this.loadall = true;
            //         }
            //         else {
            //             this.busy = false;
            //             this.page++
            //         }
            //     }).catch(function (err) {
            //         console.log(err)
            //     });
            // },
            // loadMore() {
            //     this.busy = true;
            //     setTimeout(() => {
            //         this.shops(this.page > 1);
            //     }, 500);
            // },
            dw_href: function () {//定位跳转
                this.$router.push({ name: 'locational' })
            },
            getwxconfig() {
                var vm = this;
                this.$http.get(this.APIURL_PREFIX + "/api/wxs/config?url=" + escape(location.href.split('#')[0])).then((response) => {
                    console.log(response.data);
                    var appid = 'wx488ae3f57360b7ea';
                    wx.config({
                        debug: false,
                        appId: appid,
                        timestamp: response.data.data.timestamp,
                        nonceStr: response.data.data.noncestr,
                        signature: response.data.data.signature,
                        jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareWeibo', 'onMenuShareQZone', 'scanQRCode', 'getLocation']
                    });
                    wx.ready(function () {
                        console.log('ready')
                        wx.getLocation({
                            type: 'gcj02', // 默认为wgs84的gps坐标，如果要返回直接给openLocation用的火星坐标，可传入'gcj02'
                            success: function (res) {
                                var latitude = res.latitude; // 纬度，浮点数，范围为90 ~ -90
                                var longitude = res.longitude; // 经度，浮点数，范围为180 ~ -180。
                                // if(latitude==""||longitude==""){
                                //    vm.msg='失败'
                                //    layer.msg("获取地理位置失败")
                                var exp = undefined;
                                if(exp==vm.Var_city){
                                  vm.latitude1 = latitude;
                                  vm.longitude1 = longitude;
                                  vm.shopsList = [];
                                  vm.busy = false;
                                  vm.loadall = false;
                                  vm.map()
                                  console.log("微信获取经度:", vm.latitude1);
                                  console.log("微信获取纬度:", vm.longitude1);
                                  console.log("判断为"+vm.Var_city)
                                  console.log("进入微信坐标")
                                // }
                                }else{
                                  vm.latitude1=vm.Var_lat
                                  vm.longitude1=vm.Var_lon
                                  vm.shopsList = [];
                                  vm.busy = false;
                                  vm.loadall = false;
                                  vm.currentCity=vm.Var_city
                                  vm.loadMore();
                                  console.log("手动选择城市")
                                   console.log("判断为"+vm.Var_city)
                                }
                            },
                            fail: function () {//失败
                                vm.msg = '失败'
                            },
                            cancel: function () {//取消
                                vm.latitude1 = -1
                                vm.longitude1 = -1
                            }
                        });
                         wx.onMenuShareTimeline({
                            title: vm.TiTle,
                            // link: "http://"+window.location.host+"/wap/wx/login?fk=1-35-"+localStorage.headid+"-no",
                           link: "http://"+window.location.host+"/wap/wx/login?fk=1-35-"+localStorage.headid+"-0-" + localStorage.headid,
                            desc:vm.shuoming,
                            imgUrl:"http://static.ruitaowang.com/attached/file/2018/11/06/20181106144126178.jpg",
                            success: function () {
                            },
                            cancel: function () {
                            }
                        });
                        wx.onMenuShareAppMessage({
                             title: vm.TiTle,
                          link: "http://"+window.location.host+"/wap/wx/login?fk=1-35-"+localStorage.headid+"-0-" + localStorage.headid,
                            desc:vm.shuoming,
                            imgUrl:"http://static.ruitaowang.com/attached/file/2018/11/06/20181106144126178.jpg",
                            success: function () {
                            },
                            cancel: function () {
                            }
                        });
                        wx.onMenuShareQQ({
                            title: vm.TiTle,
                          link: "http://"+window.location.host+"/wap/wx/login?fk=1-35-"+localStorage.headid+"-0-" + localStorage.headid,
                            desc:vm.shuoming,
                            imgUrl:"http://static.ruitaowang.com/attached/file/2018/11/06/20181106144126178.jpg",
                            success: function () {
                            },
                            cancel: function () {
                            }
                        });
                        wx.onMenuShareWeibo({
                            title: vm.TiTle,
                          link: "http://"+window.location.host+"/wap/wx/login?fk=1-35-"+localStorage.headid+"-0-" + localStorage.headid,
                            desc:vm.shuoming,
                            imgUrl:"http://static.ruitaowang.com/attached/file/2018/11/06/20181106144126178.jpg",
                            success: function () {
                            },
                            cancel: function () {
                            }
                        });
                        wx.onMenuShareQZone({
                            title: vm.TiTle,
                          link: "http://"+window.location.host+"/wap/wx/login?fk=1-35-"+localStorage.headid+"-0-" + localStorage.headid,
                            desc:vm.shuoming,
                            imgUrl:"http://static.ruitaowang.com/attached/file/2018/11/06/20181106144126178.jpg",
                            success: function () {
                            },
                            cancel: function () {
                            }
                        });
                        // wx.onMenuShareTimeline({
                        //   title: document.title,
                        //   link: Config.activity_host+'/wap/wx/login?fk=1-15-'+userId+'-'+$.urlParam("fk").split("-")[3],
                        //   imgUrl:app.imgSrc,
                        //   desc:$("#desc p").html(),
                        //   success: function () {
                        //   },
                        //   cancel: function () {
                        //   }
                        // });
                        // wx.onMenuShareAppMessage({
                        //   title: document.title,
                        //   link: Config.activity_host+'/wap/wx/login?fk=1-15-'+userId+'-'+$.urlParam("fk").split("-")[3],
                        //   imgUrl:app.imgSrc,
                        //   desc:$("#desc p").html(),
                        //   success: function () {
                        //   },
                        //   cancel: function () {
                        //   }
                        // });
                        // wx.onMenuShareQQ({
                        //   title: document.title,
                        //   link: Config.activity_host+'/wap/wx/login?fk=1-15-'+userId+'-'+$.urlParam("fk").split("-")[3],
                        //   imgUrl:app.imgSrc,
                        //   desc:$("#desc p").html(),
                        //   success: function () {
                        //   },
                        //   cancel: function () {
                        //   }
                        // });
                        // wx.onMenuShareWeibo({
                        //   title: document.title,
                        //   link: Config.activity_host+'/wap/wx/login?fk=1-15-'+userId+'-'+$.urlParam("fk").split("-")[3],
                        //   imgUrl:app.imgSrc,
                        //   desc:$("#desc p").html(),
                        //   success: function () {
                        //   },
                        //   cancel: function () {
                        //   }
                        // });
                        // wx.onMenuShareQZone({
                        //   title: document.title,
                        //   link: Config.activity_host+'/wap/wx/login?fk=1-15-'+userId+'-'+$.urlParam("fk").split("-")[3],
                        //   imgUrl:app.imgSrc,
                        //   desc:$("#desc p").html(),
                        //   success: function () {
                        //   },
                        //   cancel: function () {
                        //   }
                        // });

                    });
                }).catch(function (err) {
                    console.log(err)
                });

            }
        },
        beforeRouteLeave( to, from,next){
             this.newding=2
            console.log(this.newding)


            if (to.name == 'commodity_details') {
                to.meta.isUseCache = true;
            }
            next();
        },

    }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
